package com.zdpx.pxframework.system.api;

import com.zdpx.pxframework.core.pojo.LoginUser;
import com.zdpx.pxframework.core.vo.PageResult;
import com.zdpx.pxframework.core.vo.Result;
import com.zdpx.pxframework.system.entity.MenuInfo;
import com.zdpx.pxframework.system.vo.query.MenuInfoQuery;
import com.zdpx.pxframework.system.vo.vo.MenuInfoTreeVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

import java.util.List;
import java.util.Set;


/**
 * 菜单 接口Swagger Api
 *
 * @Description:
 * @Author: Cheng XiaoXiao
 * @Date: 2022-02-27 15:20:14
 */
@Api(tags = "菜单模块", description = "实现对菜单数据的基本操作")
public interface MenuInfoControllerApi {


    /**
     * 按照条件查询菜单信息
     *
     * @param menuInfoQuery 查询条件
     * @return 结果信息
     */
    @ApiOperation(value = "按照条件查询菜单信息")
    Result<List<MenuInfo>> list(MenuInfoQuery menuInfoQuery);

    /**
     * 分页及条件查询菜单信息
     *
     * @param page          页码
     * @param size          分页大小
     * @param menuInfoQuery 查询条件
     * @return 分页结果信息
     */
    @ApiOperation(value = "分页及条件查询菜单信息")
    Result<PageResult<MenuInfo>> search(@ApiParam(name = "page", value = "当前页", required = true, type = "path") Long page,
                                        @ApiParam(name = "size", value = "页码大小", required = true, type = "path") Long size,
                                        MenuInfoQuery menuInfoQuery);

    /**
     * 根据ID获取菜单详情
     *
     * @param id 菜单ID
     * @return 菜单详细信息
     */
    @ApiOperation(value = "获取单个菜单详情")
    @ApiParam(name = "id", value = "菜单ID", required = true, type = "path")
    Result<MenuInfo> detail(String id);

    /**
     * 增加菜单信息
     *
     * @param menuInfo 菜单增加实体
     * @return 增加后的菜单信息
     */
    @ApiOperation(value = "增加菜单信息")
    Result<MenuInfo> add(MenuInfo menuInfo);

    /**
     * 修改菜单信息
     *
     * @param id       菜单ID
     * @param menuInfo 菜单修改实体
     * @return 修改后的菜单信息
     */
    @ApiOperation(value = "修改菜单信息")
    Result<MenuInfo> updateById(@ApiParam(name = "id", value = "菜单ID", type = "path") String id, MenuInfo menuInfo);

    /**
     * 删除菜单信息
     *
     * @param id 菜单ID
     * @return 删除结果信息
     */
    @ApiOperation(value = "删除单个菜单信息")
    Result<Boolean> deleteById(@ApiParam(name = "id", value = "菜单ID", type = "path") String id);

    /**
     * 删除菜单信息
     *
     * @param idList 菜单ID数组
     * @return 删除结果信息
     */
    @ApiOperation(value = "批量删除菜单信息")
    Result<Boolean> batchRemove(List<String> idList);

    /**
     * 查询菜单树形结构
     *
     * @return 菜单树形结构
     */
    @ApiOperation(value = "查询菜单树形结构")
    Result<List<MenuInfoTreeVo>> tree();


    /**
     * 根据登录用户信息获取菜单列表
     *
     * @return 此用户的菜单列表信息
     */
    @ApiOperation(value = "根据登录用户信息获取菜单列表")
    Result<List<MenuInfoTreeVo>> treeMenuByLoginUser(LoginUser loginUser);


    /**
     * 根据用户ID获取拥有的权限标识列表
     *
     * @param userId 用户ID
     * @return 菜单标识列表
     */
    @ApiOperation(value = "根据用户ID获取权限标识列表")
    @ApiParam(name = "id", value = "用户ID", required = true, type = "path")
    Result<Set<String>> getMenuKeysByUserId(@ApiParam(name = "userId", value = "用户ID", type = "path") String userId);


}
